<?php use_javascript('global') ?>
<?php include_partial('global/userMessages', array('flash_name' => 'field_errs')) ?>
<form id='main_form' method='post' action='<?php echo url_for("@edit_field?field_id={$field['field_id']}") ?>' enctype='application/x-www-form-urlencoded'>
<div id="newforms">
<div class="formcontain">
<div class="farmform">
<!-- FIELD INFORMATION -->
<h1>Field Information</h1>

<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">
        <td class='req'>Field Name</td>
        <td class='req'>Field Year</td>
        <td>Acres</td>
        <td>Herbicide Used</td>
        <td>Preceding Crop</td>
        <td>Current Crop</td>
        <td>Date Planted <br /> (month/day/year)</td>
        <td>Lime Applied</td>
    </tr>
    <tr>
        <td><input type="text" class='txt req' name="field_name" maxlength="25" value="<?php echo $field['field_name'] ?>" /></td>
        <td><?php include_partial('yearOptions', array('singular' => true, 'year' => $field['year'])) ?></td>
        <td class='int'><input type="text" class='txt' name="acres" maxlength='10' value="<?php echo $field['acres'] ?>" /></td>
        <td><input type="text" class='txt' name="herbicide_used" maxlength="25" value="<?php echo $field['herbicide_used'] ?>" /></td>
        <td><?php include_partial('precedingCropOptions', array('preceding_crop' => $field['preceding_crop'])) ?></td>
        <td><?php include_partial('currentCropOptions', array('current_crop' => $field['current_crop'])) ?></td>
        <td class='date'>
        	<?php include_partial(
        		'global/dateBox', 
        		array(
        			'singular' => true, 
        			'prefix' => 'fi',
        			'month' => $field['fi_month'], 
        			'day' => $field['fi_day'],
        			'year'	=> $field['fi_year']
        		)
        	)
        	?>
        </td>
        <td><?php include_partial('limeAppliedOptions', array('lime_applied' => $field['lime_applied'])) ?></td>
            
    </tr>
</table>
<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2" name="comments"><?php echo $field['comments'] ?></textarea></td>
    </tr>
</table>
<!-- FIELD FERTILITY -->
<h1>Field Fertility</h1>
<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">
        <td>N_PSNT</td>
        <td>Bray P1</td>
        <td>K</td>
        <td>NH<sub>4</sub></td>
        <td>Soil pH</td>
        <td>Buffered pH</td>
    </tr>
    <tr>   
        <td><input type="text" class='txt'  name="f_npsnt" maxlength="25" value="<?php echo $field['f_N_PSNT'] ?>" /></td>
        <td><input type="text" class='txt'  name="f_brayp1" maxlength="25" value="<?php echo $field['f_brayp1'] ?>" /></td>
        <td><input type="text" class='txt'  name="f_k" maxlength="25" value="<?php echo $field['f_K'] ?>" /></td>
        <td><input type="text" class='txt'  name="f_nh4" maxlength="25" value="<?php echo $field['f_NH4'] ?>" /></td>
        <td><input type="text" class='txt'  name="f_soilph" maxlength="25" value="<?php echo $field['f_soilph'] ?>" /></td>
        <td><input type="text" class='txt'  name="f_bufferedph" maxlength="25" value="<?php echo $field['f_bufferedph'] ?>" /></td>
    </tr>
</table>
<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2"  name="f_comments"><?php echo $field['f_comments'] ?></textarea></td>
    </tr>
</table>
<!-- NUTRIENTS ADDED -->
<h1>Nutrients Added</h1>
<table class='tbl' border="0">
    <tr class="tr_one">
        <td>N</td>
        <td>P</td>
        <td>K</td>
    </tr>

    <tr>
        <td><input type="text" class='txt'  name="na_N" maxlength='10' value="<?php echo $field['na_N']?>" /></td>
        <td><input type="text" class='txt'  name="na_P" maxlength='10' value="<?php echo $field['na_P']?>" /></td>
        <td><input type="text" class='txt'  name="na_K" maxlength='10' value="<?php echo $field['na_K']?>" /></td>
    </tr>
</table>


<table class='tbl' border="0">
    <tr class="tr_one">
        <td>Manure</td>
        <td>Type</td>
        <td><sub>m</sub>N</td>
        <td><sub>m</sub>P</td>
        <td><sub>m</sub>K</td>
    </tr>

    <tr>
        <td class='xsm'><?php include_partial('manureOptions', array('singular' => true, 'manure' => $field['na_manure'])) ?></td>
        <td><input type="text" class='txt'  name="na_type" maxlength="100" value="<?php echo $field['na_type']?>" /></td>
        <td class='int'><input type="text" class='txt'  name="na_mN" maxlength='10' value="<?php echo $field['na_mN']?>" /></td>
        <td class='int'><input type="text" class='txt' name="na_mP" maxlength='10' value="<?php echo $field['na_mP']?>" /></td>
        <td class='int'><input type="text" class='txt' name="na_mK" maxlength='10' value="<?php echo $field['na_mK']?>" /></td>
    </tr>
</table>

<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2" name="na_comments"><?php echo $field['na_comments'] ?></textarea></td>
    </tr>
</table>
<!-- COVER CROP -->
<h1>Cover Crop</h1>
<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">
        <td>Family</td>
        <td>Used</td>
        <td>Rate</td>
        <td>Seed Cost</td>
        <td>Cost Share</td>
        <td>Planting Method</td>
        <td>Date Planted<br /> (month/day/year)</td>
        <td>Q.S. Fall</td>
        <td>Q.S. Spring</td>
    </tr>
    <tr>
        <td class='md'><?php include_partial('familyOptions', array('cc_family' => $field['cc_family'])) ?></td>
        <td class='lg'><?php include_partial('ccUsedOptions', array('cc_used' => $field['cc_used'])) ?></td>
        <td class='int'><input type="text" class='txt'  name="cc_rate" maxlength='10' value="<?php echo $field['cc_rate'] ?>" /></td>
        <td class='int'><input type="text" class='txt'  name="cc_seed_cost" maxlength='10' value="<?php echo $field['cc_seed_cost'] ?>" /></td>
        <td class='xsm'><?php include_partial('costShareOptions', array('cost_share' => $field['cc_cost_share'])) ?></td>
        <td class='lg'><?php include_partial('plantingMethodOptions', array('method' => $field['cc_planting_method'])) ?></td>
        <td class='date'>
        	<?php include_partial(
        		'global/dateBox', 
        		array(
        			'singular' => true, 
        			'prefix' => 'cc',
        			'month' => $field['cc_month'], 
        			'day' => $field['cc_day'],
        			'year'	=> $field['cc_year']
        		)
        	)
        	?>
        </td>
        <td class='xxs'><?php include_partial('qualityScoreOptions', array('season' => 'fall', 'score' => $field['cc_fall_quality'])) ?></td>
        <td class='xxs'><?php include_partial('qualityScoreOptions', array('season' => 'spring', 'score' => $field['cc_spring_quality'])) ?></td>
    </tr>
</table>
<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">
        <td>Termination Method</td>
        <td>Termination Chemical Used</td>
        <td>Carrier</td>
        <td># of Times Sprayed</td>
        <td>Termination Temp</td>
        <td>Termination Weather</td>
        <td>Termination Date<br /> (month/day/year)</td>
        <td>Successful Termination</td>
        <td>Yield</td>
    </tr>
    <tr>
        <td><input type="text" class='txt'  name="cc_term_method" maxlength="25" value="<?php echo $field['cc_term_method'] ?>" /></td>
        <td><input type="text" class='txt'  name="cc_term_chem" maxlength="25" value="<?php echo $field['cc_term_chem'] ?>" /></td>
        <td><input type="text" class='txt'  name="cc_carrier" maxlength='25' value="<?php echo $field['cc_carrier'] ?>" /></td>
        <td class='int'><input type="text" class='txt'  name="cc_sprayed" maxlength='10' value="<?php echo $field['cc_spray_count'] ?>" /></td>
        <td class='int'><input type="text" class='txt'  name="cc_term_temp" maxlength='10' value="<?php echo $field['cc_term_temp'] ?>" /></td>
        <td><?php include_partial('weatherOptions', array('weather' => $field['cc_term_weather'])) ?></td>
        <td class='date'>
        	<?php include_partial(
        		'global/dateBox', 
        		array(
        			'singular' => true, 
        			'prefix' => 'cc_term',
        			'month' => $field['cc_term_month'], 
        			'day' => $field['cc_term_day'],
        			'year'	=> $field['cc_term_year']
        		)
        	)
        	?>
        </td>
        <td><?php include_partial('termSuccessOptions', array('answer' => $field['cc_term_success'])) ?></td>
        <td class='int'><input type="text" class='txt'  name="cc_yield" maxlength='10' value="<?php echo $field['cc_yield'] ?>" /></td>
    </tr>
</table>

<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2" name="cc_comments"><?php echo $field['cc_comments'] ?></textarea></td>
    </tr>
</table>
<!-- CONSERVATION TILLAGE -->
<h1>Conservation Tillage</h1>
<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">
        <td>Tillage Acres</td>
        <td>Previous Tillage</td>
        <td>Current Tillage</td>
    </tr>
    <tr>
        <td class='int'><input name="ct_acres" type="text" class='txt'  maxlength='10' value="<?php echo $field['ct_acres'] ?>" /></td>
        <td><?php include_partial('tillageOptions', array('period' => 'previous', 'tillage' => $field['ct_previous'])) ?></td>
        <td><?php include_partial('tillageOptions', array('period' => 'current', 'tillage' => $field['ct_current'])) ?></td>
    </tr>
</table>
<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2" name="ct_comments"><?php echo $field['ct_comments'] ?></textarea></td>
    </tr>
</table>
<!-- PEST CONTROL -->
<h1>Pest Control</h1>
<table class='tbl' border="0">
    <tr style="text-align:center; background-color:#CCC;">  
        <td>Pest</td>
        <td>Threshold</td>
        <td>Method</td>
        <td>Chemical Application Rate</td>
        <td>Application Date<br /> (month/day/year)</td>
    </tr>
    <tr> 
        <td><input type="text" class='txt'  name="pc_pest" maxlength="25" value="<?php echo $field['pc_pest'] ?>" /></td>
        <td><input type="text" class='txt'  name="pc_threshold" maxlength="25" value="<?php echo $field['pc_threshold'] ?>" /></td>
        <td><input type="text" class='txt'  name="pc_method" maxlength="25" value="<?php echo $field['pc_method'] ?>" /></td>
        <td><input type="text" class='txt'  name="pc_chem_app_rate" maxlength="25" value="<?php echo $field['pc_CAP'] ?>" /></td>
        <td class='date'>
        	<?php include_partial(
        		'global/dateBox', 
        		array(
        			'singular' => true, 
        			'prefix' => 'pc_app',
        			'month' => $field['pc_app_month'], 
        			'day' => $field['pc_app_day'],
        			'year'	=> $field['pc_app_year']
        		)
        	)
        	?>
        </td>
    </tr>
</table>
<table>
    <tr>
        <td class='note'>Comments</td>
        <td><textarea cols='25' rows="2" name="pc_comments"><?php echo $field['pc_comments'] ?></textarea></td>
    </tr>
</table>

</div>
</div>
</div>
<p id='form_btns'><input id='submit_btn' type='submit' value='Update' /></p>
<input type='hidden' value="<?php echo $field['field_id'] ?>" name='field_id' />
<input type='hidden' value="<?php echo $field['farm_id'] ?>" name='farm_id' />
</form>
